Field of the Invention
The present invention relates to data transfer processing between an image processor and a buffer that stores image data to be processed.
Description of the Related Art
When outputting an image by image formation processing, local image processing such as spatial filter processing is performed. In the local image processing, a predetermined operation is performed using all or most pixels in a spatial filter region including pixels to be processed.
Japanese Patent Laid-Open No. 2006-139606 (literature 1) describes a technique of performing local image processing as parallel distributed processing. According to the technique of literature 1, an image is divided into a plurality of regions in the sub-scanning direction (to be referred to as “one dimensional division” hereinafter), and image processing using sequential processing or parallel distributed processing is performed for the divided regions. The method of processing each region obtained by one dimensional division of an image will be referred to as “band processing”.
In the band processing, to perform local image processing closely between band regions, a contrivance is made such that images partially overlap at the boundary between a band region and an adjacent band region. In literature 1, when performing local image processing for a band region, the pixels are scanned one by one in the height direction (sub-scanning direction) of the band region. The memory amount of a delay memory for holding the values of pixels necessary for the local image processing is thus defined to the height of the band region, thereby implementing saving of the capacity of the delay memory.
Region division processing for dividing an image into partial images and performing sequential processing or parallel distributed processing has various advantages such as speedup by parallel distributed processing and capacity saving of the delay memory.
One of local image processes is resolution conversion processing of converting an input image into an image of a desired size by enlargement or reduction. According to the resolution conversion processing, since the number of input pixels and the number of output pixels after the processing largely differ from each other, hardware implementation is difficult as compared to other local image processes that do not change the number of pixels between input and output of image data. Hardware implementation becomes more difficult when the resolution conversion processing is combined with the region division processing.
For example, assume that image data on a page space or the like is divided into regions (for example, bands), and resolution conversion (arbitrary magnification) is performed for each of the divided image regions. If the magnification ratio of the resolution conversion is an integer, the size of the image region after conversion is an integer multiple. It is therefore unnecessary to consider a pixel having a size represented by a fraction, that is, smaller than the one-pixel size.
On the other hand, if the magnification ratio is not an integer, a pixel having a size represented by a fraction may be generated in the image region after resolution conversion depending on the size of the input image region. When writing data of the processed image region in a storage device, it is impossible to write the pixel smaller than the one-pixel size. For this reason, it is necessary to perform “rounding” processing to represent the number of pixels by an integer by a method of, for example, writing the pixel smaller than the one-pixel size as one pixel, or neglecting it and prohibiting write, as a matter of course.
When rounding a pixel smaller than the one-pixel size, which is generated by image processing, the set value of a DMA (Direct Memory Access) used to transfer image data may change between the divided regions, and it may be impossible to continuously use the same set value. For example, a set value such as a “start address” or “number of repetitions” needed for transfer using the DMA needs to be calculated and set for each divided region in consideration of the contents of a series of image processes. In this case, the set value of the DMA according to the contents of the series of image processes is calculated for each divided region by firmware that operates on a microprocessor (CPU), and the set value calculated for each divided region is set in a DMA controller (DMAC), and the image processor is sequentially caused to operate.
An image processing apparatus is formed from many units such as a CPU that controls the entire apparatus, a storage device serving as a global buffer for storing image data to be processed, a DMAC that transfers image data on a process unit basis, and an image processor that executes image processing. These units simultaneously and/or cooperatively operate, thereby implementing desired image processing at a desired speed.
In the image processing apparatus, when inputting image data to be processed, partial image data to processed is sequentially read out from the global buffer and temporarily stored in the input local buffer of the image processor, and image processing is executed. When outputting processed image data, partial image data after image processing is temporarily stored in the output local buffer of the image processor and sequentially written in the global buffer. The image processing apparatus thus transfers image data with respect to the global buffer through the input/output local buffer, thereby implementing the simultaneous operation of the units of the image processing apparatus and the cooperative operation between the units.
When calculating the set value of the DMA for each divided region, processing of the CPU is needed for each divided region. Hence, the image processor cannot continuously process the plurality of divided regions.
In addition, when controlling data transfer to the global buffer through the local buffer to control the operations of the plurality of units, if the number of pixels of the input/output image data changes between the divided regions as in the resolution conversion processing, the data transfer cannot uniformly be defined. For this reason, for example, the number of pixels of output data is obtained for each divided region, the setting of the DMA is changed for each divided region, and the image processor is activated. When image processing of one band is completed, the image processor needs to notify the CPU of the completion of processing using an interrupt or the like and synchronize with the CPU. The CPU needs a time of, for example, several ms to receive the interrupt, check the interrupt factor, and transit to the next operation. As a result, a processing load to some degree is always applied to the CPU for synchronization with the processing of the image processor, and the CPU is not released during the image processing. Hence, a delay is needed for the simultaneous operation of the units of the image processing apparatus, and the cooperative operation between the units cannot continuously be executed.